package net.linlan;

import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties;
import net.linlan.config.DynamicDataSourceConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;


/**
 * Application main for spring boot jar
 * Filename:StageApplication.java
 * Desc: the main entrance of stage application to run, to debug
 *
 * @author Linlan
 * CreateTime:2017-10-15 2:32 PM
 *
 * @version 1.0
 * @since 1.0
 *
 */

//@SpringBootApplication      //全部注解
@Import({DynamicDataSourceConfig.class})
@MapperScan(basePackages={"net.linlan.**.dao"})
@EnableAutoConfiguration(exclude = {
        DataSourceAutoConfiguration.class
})
@Configuration
@ComponentScan(basePackages={"net.linlan"})
@EnableScheduling
@EnableAsync
@ServletComponentScan
@EnableEncryptableProperties
public class StageApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(StageApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(StageApplication.class);
    }

}

